import request from '@/utils/request'

export function createDemand(data) {
  return request({
    url: '/demand/create',
    method: 'POST',
    data
  })
}

export function getDemands(params) {
  return request({
    url: '/demands',
    method: 'GET',
    params
  })
}

export function getDemand(id) {
  return request({
    url: `/demand/${id}`,
    method: 'GET'
  })
}

export function updateDemand(data) {
  return request({
    url: `/demand/update`,
    method: 'PUT',
    data
  })
}

export function deleteDemand(id) {
  return request({
    url: `/demand/${id}`,
    method: 'DELETE'
  })
}
